package com.academia.dataAccess;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class RegisterDAO {

	public int register(String userName,String pass){
		Connection conexion = DBConnect.getInstance().connect();
		int pkUser = 0;
		String insert = "INSERT INTO (userName,pass) values (?,?)";


		try{
			PreparedStatement preparedStatement = conexion.prepareStatement(insert);
			preparedStatement.setString(1, userName);
			preparedStatement.setString(2, pass);
			
			pkUser = preparedStatement.executeUpdate();
			
		}catch(SQLException e){
			e.printStackTrace();
		}
		try {
			conexion.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return pkUser;
		

	}
}
